class Person(object):

    name = "king"
    def __init__(self, name):
        self.name = name

    @classmethod  # 把eat方法变为类方法
    def eat(self):
        print("%s is eating" % self.name)


d = Person("xiaoming")
d.eat()